package com.goldcn.goods.controller;

import com.goldcn.b2b.dto.GoodsQueryDto;
import com.goldcn.goods.dto.QueryGoodsAttrStoneDto;
import com.goldcn.goods.service.GoodsHighQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 高级查询
* @Author  tim peng
* @Date  2018/7/3  14:19
*/
@Api(value = "高级搜索")
@RestController
@RequestMapping(value = "/highQuery")
public class GoodsHighQueryController {

    @Autowired
    GoodsHighQueryService goodsHighQueryService;

    @ApiOperation(value = "b2b页面搜索", notes = "sort、sortOrder、pageNum、pageSize为必填字段")
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public Object selectList(@RequestBody QueryGoodsAttrStoneDto queryDto) {
        return goodsHighQueryService.selectList(queryDto);
    }

    @ApiOperation(value = "小商城页面搜索", notes = "sort、sortOrder、pageNum、pageSize为必填字段")
    @RequestMapping(value = "/shopList", method = RequestMethod.POST)
    public Object selectShopList(@RequestBody QueryGoodsAttrStoneDto queryDto) {
        return goodsHighQueryService.selectShopList(queryDto);
    }


    @ApiOperation(value = "初始化之前录入的是商品", notes = "sort、sortOrder、pageNum、pageSize为必填字段")
    @RequestMapping(value = "/initHighQuery", method = RequestMethod.GET)
    public Object initHighQuery() {
        return goodsHighQueryService.initHighQuery();
    }
}
